<template>
  <div class="listbox">
    <div class="search">
      <el-input
        v-model="input"
        placeholder="搜索"
        prefix-icon="el-icon-search"
      ></el-input>
    </div>
    <el-table :data="tableData" stripe style="width: 100%"  @row-dblclick="play">
      <el-table-column prop="name" label="音乐标题" width="180">
      </el-table-column>
      <el-table-column prop="ar[0].name" label="歌手" width="180">
      </el-table-column>
      <el-table-column prop="al.name" label="专辑"> </el-table-column>
      <el-table-column prop="dt" label="时长"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      input: "",
    };
  },
 methods:{
 play(item) {
      this.$store.state.mid = item.id;
      this.$root.eventhub.$emit("play");
    }
 },
  props:['tableData'],
  mounted() {
    
  },
};
</script>

<style scoped>
.listbox {
  position: relative;
}
.search {
  position: absolute;
  right: 0;
  top: -70px;
  z-index: 77;
  width: 200px;
}
</style>